import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class CustomerIdolRechargeService {

  serivceUrls = {
    queryIdolListUrl: '/idol/list', // 查询爱豆充值列表
    saveIdolDataUrl: '/idol/save', // 添加爱豆充值
    auditIdolDataUrl: '/idol/audit', // 爱豆审核
    batchGrantIdolUrl: '/idol/batchAdd' // 批量发放爱豆
  }

  constructor(public httpClient: HttpClient) { }
  
  // 查询爱豆列表
  queryIdolList(params: any) {
    return this.httpClient.post(this.serivceUrls.queryIdolListUrl, params).toPromise();
  }

  // 添加爱豆充值
  saveIdolData(params: any) {
    return this.httpClient.post(this.serivceUrls.saveIdolDataUrl, params).toPromise();
  }

  // 爱豆审核
  auditIdolData(params: any) {
    return this.httpClient.post(this.serivceUrls.auditIdolDataUrl, params).toPromise();
  }

  // 批量发放爱豆
  batchGrantIdolData(params: any) {
    return this.httpClient.post(this.serivceUrls.batchGrantIdolUrl, params).toPromise();
  }
}

